<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>主页 | 短信平台</title>
<jsp:include page="/WEB-INF/jsp/common/commonlist.jsp"></jsp:include>
<style>
	#userTable tr{
		background-color:white;
	}
	#userTable td{
		background-color:white;
	}
	
	td.td_title{
		width:80px;
	}
	
	.errorMsg{
		padding-top:9px;
		color:red;
		vertical-align: bottom;
	}
</style>
<script>
	 
	
	function submitForm(){
		//验证填写信息
		if(validateInfo()){
			$("#editUserForm").attr("action","doChangePSW.do").submit();	
		}		
		return false;
	}
	
	/**
	*验证信息
	*/
	function validateInfo(){
		var oldPSW = $('#oldPSW').val();
		var newPSW = $('#newPSW').val();
		var confirmPSW = $('#confirmPSW').val();
		
		if(oldPSW == ""){
			alert("原始密码不能为空！");
			return false;
		}
		
		if(newPSW == ''){
			alert("新密码不能为空！");
			return false;
		}
		
		if(newPSW != confirmPSW ){
			alert("两次输入密码不相同");
			return false;
		}
		
		return true;
	}
</script>
</head>
<body >
<div id="body-wrapper">
  <!-- Wrapper for the radial gradient background -->
  <div id="sidebar">
    <div id="sidebar-wrapper">
      <!-- Sidebar with logo and menu -->
      <h1 id="sidebar-title"><a href="#">短信平台</a></h1> 
      <!-- Logo (221px wide) -->
      

      <!-- Sidebar Profile links -->
            <!--  页面左上角的部分 -->
     <%@include file="/WEB-INF/jsp/common/leftTop.jsp" %>
     <!-- 页面左侧菜单部分 -->
     <%@include file="/WEB-INF/jsp/common/menu.jsp" %>
      
    </div>
  </div>
  <!-- End #sidebar -->
  <div id="main-content">
    <!-- Main Content Section with everything -->
    
    <!-- Page Head -->
   <%@ include file="/WEB-INF/jsp/common/top.jsp" %>
    <!-- End .shortcut-buttons-set -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>修改密码</h3>
        
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab2">
          <form  id="editUserForm"   method="post"  onsubmit="return submitForm()">
          <input type="hidden" name="id" value="${user.userId }" />
           <table id="userTable">
               <tr>
             <td style="width:90px;">  <label style="display: inline; width: 90px;">原始密码：</label></td>
              <td><input  maxlength="100" class="text-input small-input" type="password" id="oldPSW" name="oldPSW"  value="${user.password }"/></td>              
             </tr>
             <tr>
             <td>  <label style="display: inline; width: 90px;">新密码：</label></td>
              <td><input  maxlength="100" class="text-input small-input" type="password" id="newPSW" name="newPSW"  value="${user.password }"/></td>              
             </tr>
            <tr>
            <td><label style="display: inline; width: 90px;">确认密码：</label></td>
              <td><input maxlength="50" class="text-input small-input" type="password" id="confirmPSW" name="confirmPSW" value="${user.password }"></td>              
              </tr>          
 
            <tr>
            	<td style="text-align: left;padding-left:200px;" colspan="2">
              		<input class="button" type="submit" value="修改密码" />
				</td>
			</tr>
           </table>
            <div class="clear"></div>
            <!-- End .clear -->
          </form>
        </div>
        <!-- End #tab2 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->
    <div class="clear"></div>
    <%@ include file="/WEB-INF/jsp/common/copyright.jsp" %>
  </div>
</div>
</body>
</html>